$(document).ready(function(){
    var count=0;
    var time=null;
    var index=0;

   function run(){
       $(".section2 .imgs").find("img").eq(count).css("display","block");
       $(".section2 .imgs").find("img").eq(count).siblings().css("display","none");
       $(".section2 .btn").find("div").eq(count).css("background","#A2A2A2");
       $(".section2 .btn").find("div").eq(count).siblings().css("background","#E0E6F0");
       count++;
       if(count>4){
           count=0;
       }
       time=setTimeout(run,2000);
   }
   run();
    $(".section2 .btn").find("div").mouseover(function(){

        clearTimeout(time);
         index=$(this).index();
        $(".section2 .imgs").find("img").eq(index).css("display","block");
        $(".section2 .imgs").find("img").eq(index).siblings().css("display","none");
        $(".section2 .btn").find("div").eq(index).css("background","#A2A2A2");
        $(".section2 .btn").find("div").eq(index).siblings().css("background","#E0E6F0");
    });
    $(".section2 .btn").find("div").mouseout(function(){
        index=$(this).index();
        count=index;
        clearTimeout(time);
    });
    $(".section2 img").bind({
        mouseover:function(){
            clearTimeout(time);
        },
        mouseout:function(){
            run();
        }
    });
    ////////////////////////////////////////////
        $("nav .section1").find(".inn-ul li").bind({
            mouseover:function(){
                var index=$(this).index();
                $("nav .section1").find(".inn-ul img").eq(index).css({"bottom":"35px","display":"block"});

            },
            mouseout:function(){
                var index=$(this).index();
                $("nav .section1").find(".inn-ul img").eq(index).css({"bottom":"23px","display":"none"});
            }
        });
    $("nav .section1").children(".down").find("li").bind({
        mouseover:function(){
            //var index=$(this).index();
            $(this).css("background","white");
           $(this).find(".inn-down").css("display","block");
        },
        mouseout:function(){
            //var index=$(this).index();
            $(this).css("background","#EBECED");
            $(this).find(".inn-down").css("display","none");
        }
    });
///////////////////////////////////////
    $("nav .section3").find(".section3-2").children(".left").find("img").toggle(
        function(){
            $(this).css("left","-100px");
            $("nav .section3").find("#videos")[0].play();
            $("nav .section3").find("#videos").attr({controls:"controls"});
        },
        function(){
            $("nav .section3").find("#videos").removeAttr("controls");
        }
    );
    $("nav .section3").find(".right").bind({
        mouseover:function(){
            $("nav .section3").find(".back").css("display","block");
        },
        mouseout:function(){
            $("nav .section3").find(".back").css("display","none");
        }
    });
$("header .top").children(".right").find("ul li").eq(0).bind({
    mouseover:function(){
        $(this).find("i").css("transform","rotate(180deg)");
        $(this).css("background","white");
        $("header .top").children(".right").find(".inn-box1").css("display","block");
    },
    mouseout:function(){
        $(this).find("i").css("transform","rotate(0deg)");
        $(this).css("background","#F2F2F2");
        $("header .top").children(".right").find(".inn-box1").css("display","none");
    }
});







});
